<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<meta charset="utf-8">
<title>联硕培训--消防工程师培训</title>
<link href="css/index.css" rel="stylesheet" type="text/css" />
<script src="js/jquery-1.11.0.min.js"></script>

<script>
$(document).ready(function(e) {
   // 得到显示的栏目名称
    var stritem=$("#itemname").text();
  // 左侧栏目列表中，找到属性a等于要显示栏目名称的li，把该li的样式设置为currentStyle，其他的同级样式都去掉currentStyle
    $(".listLeft ul li[a='"+stritem+"']").addClass("currentStyle").siblings().removeClass("currentStyle");
});
</script>
</head>

<body>
<div class="layout">
   <!-- 头部，包括LOGO和导航和BNNAER -->
    <%@include file="head.jsp"%>
   
   <!-- 内容 -->
   <div class="inWid main">
        <div class="listLeft">
            <div class="weizhi"><span>您所在的位置：主页</span>><span id="itemname">${items.itemname}</span></div>
             <ul>
                 <c:forEach items="${itemlist}" var="item">
               <li a="${item.itemname}"><a href="FindAllWithPage?itemid=${item.id}">${item.itemname}</a> </li>
                 </c:forEach>


            </ul>
        </div>
        <!-- end of left -->
        <div class="listRight">
            <div class="listRightHead">${items.itemname}</div>
            <div class="wid listRightMain">
                <ul>
                    <c:forEach items="${pageBean.list}" var="newsitem">
                        <li>
                            <div class="LR_title"><a href="findNewsByid?id=${newsitem.id}">
                                    ${newsitem.title}</a><span>${newsitem.tdate}</span></div>
                            <!--取内容的前50个字符-->
                            <div class="wid LR_content"><a href="findNewsByid?id=${newsitem.id}">
                                    ${fn:substring(newsitem.content,1, 50)}...</a></div>
                        </li>
                    </c:forEach>
                </ul>
                <div class="fenye">
                    <span><a href="FindAllWithPage?pageNum=1&itemid=${items.id}">第一页</a></span>
                    <span>
                        <!--如果本身是第一页，则第一页不能有超链接-->
                        <c:choose>
                            <c:when test="${pageBean.pageNum==1}">
                                上一页
                            </c:when>
                            <c:otherwise>
                                <a href="FindAllWithPage?pageNum=${pageBean.pageNum-1}&itemid=${items.id}"> 上一页</a>
                            </c:otherwise>
                        </c:choose>

                    </span>
                    <span>
                        <!--如果已到最后一页，则下一页不能有超链接-->
                        <c:choose>
                            <c:when test="${pageBean.pageNum==pageBean.totalPage}">
                                下一页
                            </c:when>
                            <c:otherwise>
                                  <a href="FindAllWithPage?pageNum=${pageBean.pageNum+1}&itemid=${items.id}">下一页<a></a>
                            </c:otherwise>
                        </c:choose>
                      </span>
                    <span>第<input type="text" value="${pageBean.pageNum}" />页/共<a>${pageBean.totalPage }</a>页</span>
                    <span><a href="FindAllWithPage?pageNum=${pageBean.totalPage}&itemid=${items.id}">最后一页</a></span>
                </div>
            </div>
        </div>
        <!-- end of right -->
   </div>
   <!-- end of 内容 -->
   
   <!-- 版权所有-->
<%@include file="foot.jsp"%>
</div>
</body>
</html>
